home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / mac / files / ID99MENU.DIR / 00140.ls < prev    next >
Encoding:
Text File  |  1999-04-29  |  1.8 KB  |  50 lines

  1. property s, getgoingtime, myloc, mystartloc, mypercent, mywidth, myheight
  2. global tickrate, stagedone, talkaboutbronze
  3.  
  4. on beginSprite me
  5.   s = me.spriteNum
  6.   mywidth = the width of sprite s
  7.   myheight = the height of sprite s
  8.   myloc = the loc of sprite s
  9.   mystartloc = point(random(800), random(600))
  10.   set the width of sprite s to 10
  11.   set the height of sprite s to 10
  12.   set the loc of sprite s to mystartloc
  13.   mypercent = random(200) * -1
  14.   getgoingtime = random(180)
  15. end
  16.  
  17. on prepareFrame me
  18.   if getgoingtime < the ticks then
  19.     if the loc of sprite s = myloc then
  20.       set the width of sprite s to float(mywidth) / 100 * (mypercent - 100)
  21.       set the height of sprite s to float(myheight) / 100 * (mypercent - 100)
  22.       mypercent = min(200, mypercent + tickrate)
  23.     else
  24.       if mypercent = 100 then
  25.         set the loc of sprite s to myloc
  26.       else
  27.         if talkaboutbronze then
  28.           if mypercent > 50 then
  29.             set the locH of sprite s to the mouseH + (float(myloc.locH - the mouseH) / 100 * mypercent)
  30.             set the locV of sprite s to the mouseV + (float(myloc.locV - the mouseV) / 100 * mypercent)
  31.           else
  32.             set the locH of sprite s to mystartloc.locH + (float(the mouseH - mystartloc.locH) / 100 * mypercent)
  33.             set the locV of sprite s to mystartloc.locV + (float(the mouseV - mystartloc.locV) / 100 * mypercent)
  34.           end if
  35.         else
  36.           set the locH of sprite s to mystartloc.locH + (float(myloc.locH - mystartloc.locH) / 100 * mypercent)
  37.           set the locV of sprite s to mystartloc.locV + (float(myloc.locV - mystartloc.locV) / 100 * mypercent)
  38.         end if
  39.         mypercent = min(100, mypercent + tickrate)
  40.       end if
  41.     end if
  42.   end if
  43. end
  44.  
  45. on donestage me
  46.   if mypercent < 200 then
  47.     stagedone = 0
  48.   end if
  49. end
  50.